using System;
using System.Collections.Generic;
using System.Windows.Forms;
using MacomberMap.Loader.User_Interfaces.CIM;
using MacomberMap.Common.Internals;
using System.Threading;
using MacomberMap.Loader.User_Interfaces.Database;
using MacomberMap.Common.Logging;
using MacomberMap.Common.Database_Interface;
using MacomberMap.Common.Database_Interface.CIM;
using MacomberMap.Common.Database_Interface.CIM.One_Line_Interface;
using MacomberMap.Common.User_Interfaces.Components;

namespace MacomberMap.Loader
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
                //Load our configuration file and initialize our repository
                MM_Log.Initialize();
                MM_Configuration.LoadConfiguration();

                //Start our UI
                Thread.CurrentThread.Name = "Main Thread";
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                using (frmDatabase DbLoader = new frmDatabase())
                    if (DbLoader.ShowDialog() == DialogResult.OK)
                        Application.Run(new frmCIM(DbLoader.dbConnection as MM_Database_Oracle, DbLoader.CIMDb));

            }
    }
}